#include "pstyledframeplugin.h"

PStyledFramePlugin::PStyledFramePlugin(QObject *parent)
 : QObject(parent)
{
 initialized = false;
}


PStyledFramePlugin::~PStyledFramePlugin()
{
}


void PStyledFramePlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
    if (initialized)
        return;

    initialized = true;
}

bool PStyledFramePlugin::isInitialized() const
{
    return initialized;
}

QWidget *PStyledFramePlugin::createWidget(QWidget *parent)
{
  PStyledFrame *f = new PStyledFrame(parent);
  f->setTopLeftPixmap(QPixmap(":/rsc/top_left.png"));
  f->setTopRightPixmap(QPixmap(":/rsc/top_right.png"));
  f->setBottomLeftPixmap(QPixmap(":/rsc/bottom_left.png"));
  f->setBottomRightPixmap(QPixmap(":/rsc/bottom_right.png"));
  f->setTopFramePixmap(QPixmap(":/rsc/top_strech.png"));
  f->setLeftFramePixmap(QPixmap(":/rsc/left_strech.png"));
  f->setRightFramePixmap(QPixmap(":/rsc/right_strech.png"));
  f->setBottomFramePixmap(QPixmap(":/rsc/bottom_strech.png"));
  return f;
}

QString PStyledFramePlugin::name() const
{
    return "PStyledFrame";
}

QString PStyledFramePlugin::group() const
{
    return "Pripares";
}

QIcon PStyledFramePlugin::icon() const
{
    return QIcon(":/rsc/pripares.png");
}

QString PStyledFramePlugin::toolTip() const
{
    return "A Styled frame widget";
}

QString PStyledFramePlugin::whatsThis() const
{
    return "";
}

bool PStyledFramePlugin::isContainer() const
{
    return true;
}

QString PStyledFramePlugin::domXml() const
{
    return "<widget class=\"PStyledFrame\" name=\"styledFrame\">\n"
           " <property name=\"geometry\">\n"
           "  <rect>\n"
           "   <x>0</x>\n"
           "   <y>0</y>\n"
           "   <width>75</width>\n"
           "   <height>25</height>\n"
           "  </rect>\n"
           " </property>\n"
           " <property name=\"toolTip\" >\n"
           "  <string>A Styled Frame</string>\n"
           " </property>\n"
           " <property name=\"whatsThis\" >\n"
           "  <string>A custom user styled button.</string>\n"
           " </property>\n"
           " <property name=\"states\" >\n"
           "  <number>1</number>"
           " </property>\n"
           "</widget>\n";
}

QString PStyledFramePlugin::includeFile() const
{
    return "pstyledframe.h";
}

QString PStyledFramePlugin::codeTemplate() const
{
    return "";
}

//Q_EXPORT_PLUGIN(PStyledFramePlugin)
Q_EXPORT_PLUGIN2(PStyledFrame, PStyledFramePlugin)
